import { service } from '@/api'

export const uploadFile = (formdata) => {
  return new Promise((resolve, reject) => {
    service.defaults.baseURL = 'http://192.168.0.248:9000'
    service({
      url: '/ontheway/uploadFile',
      method: 'post',
      headers: {
        'Content-type' : 'multipart/form-data;charset-UTF-8'
      },
      data: formdata
    })
    .then(async res => {
      resolve(res)
    }).catch(err => {
      reject(err)
    })
  })
}